Skip to content

feat: backport /pr-loop command + merge-ready.sh from downstream - #17

Merged
robercano merged 3 commits into
mainfrom
chore/backport-pr-loop
Jun 30, 2026
Merged

feat: backport /pr-loop command + merge-ready.sh from downstream#17
robercano merged 3 commits into
mainfrom
chore/backport-pr-loop

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Backports two pieces of the autonomous PR-loop automation that proved out downstream (in a project adapted from this framework) so any adapted project gets them out of the box.

What

  1. .claude/scripts/merge-ready.sh (new) — merges every open PR the repo owner has APPROVED that is mergeable and fully CI-green, then deletes the branch. It never approves anything (the human Approve stays the only gate) and only merges when the approval was submitted at/after the PR's last commit (so a free private repo with no branch-protection auto-dismiss never merges commits the owner hasn't seen). Generalized for the framework: repo is derived from the git remote (override $1), the approver defaults to the repo owner login (override $APPROVER), base branch comes from gates.json merge.baseBranch. Runs as the bot (GH_BOT_TOKEN); merging ≠ approving, so the bot may merge bot-authored PRs. This is step 2 ("Merge") of the loop described in docs/USAGE.md, which until now had no script.
  2. .claude/commands/pr-loop.md (new — first entry under .claude/commands/) — a slash command that idempotently (re)arms the adaptive-cadence PR-loop cron with the canonical tick prompt and runs one tick immediately. Restores the whole loop in a single /pr-loop at the start of any session (cron jobs are session-scoped and don't reliably persist). Uses only framework scripts: notify-poll.sh (poll), merge-ready.sh (merge), pr-feedback.sh (address feedback), bot-gh.sh (bot-authored PRs). No project-specific values — repo via gh repo view, base via gates.json, bot via $BOT_LOGIN.

Notes

  • Both files are created via the contents API, so merge-ready.sh lands as mode 100644. It's always invoked as bash .claude/scripts/merge-ready.sh, so the missing exec bit is functionally irrelevant; chmod +x if you want parity with the other scripts.
  • Consider a follow-up to docs/USAGE.md referencing /pr-loop and merge-ready.sh in the PR-feedback-loop and cron sections.

🤖 Generated with Claude Code

@robercano
robercano merged commit 147109b into main Jun 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants